package com.moss.cloud.base.biz.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.moss.cloud.base.api.model.from.ApprovalFrom;
import com.moss.cloud.base.api.model.from.BaseFrom;
import com.moss.cloud.base.api.model.from.FlowBusinessFrom;
import com.moss.cloud.base.api.model.from.TaskFrom;
import com.moss.cloud.base.api.model.param.FlowBusinessParam;
import com.moss.cloud.base.api.model.vo.FlowBusinessVO;
import com.moss.cloud.base.api.model.vo.FlowTaskVO;
import com.moss.cloud.base.biz.model.FlowBusiness;
import com.moss.cloud.base.biz.model.FlowTask;
import com.moss.cloud.common.flow.model.NodeTask;

import java.util.List;

/**
 * 业务流程业务接口
 *
 * @author 瑾年
 * @date 2024-03-06
 */
public interface IFlowBusinessService extends IService<FlowBusiness> {

    /**
     * 分页查询
     *
     * @param param
     * @return
     */
    IPage<FlowBusinessVO> page(FlowBusinessParam param);

    /**
     * 新增
     *
     * @param from
     * @return
     */
    boolean saveFlowBusiness(FlowBusinessFrom from);

    /**
     * 更新
     *
     * @param from
     * @return
     */
    boolean update(FlowBusinessFrom from);

    /**
     * 删除
     *
     * @param baseFrom
     * @return
     */
    boolean remove(BaseFrom baseFrom);

    /**
     * 详情
     *
     * @param baseFrom
     * @return
     */
    FlowBusinessVO detail(BaseFrom baseFrom);

    /**
     * 获取任务节点
     *
     * @param from
     * @return
     */
    List<FlowTaskVO> nodeTasks(TaskFrom from);

    /**
     * 流程审批
     *
     * @param approvalFrom
     * @return
     */
    boolean approval(ApprovalFrom approvalFrom);

    /**
     * 下一个任务
     *
     * @param flowTask
     */
    void nextTask(FlowTask flowTask);
}
